/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ResourceManager;

import GameCore.ResourceSetting;
import GameObject.Card;
import GameObject.Effect;
import GameObject.VisibleGameObject;

/**
 *
 * @author NGUYEN VAN TAM
 */
public class EffectManager extends EntityManager
{
    @Override
    public void InitPrototype()
    {
        _nprototype = ResourceSetting.Effect_nEffect;
        _prototype = new Effect[_nprototype];

        for (int i = 0; i < _nprototype; i++)
        {
            _prototype[i] = new Card();
            ((Effect)_prototype[i]).Init(ResourceSetting.EffectSprite(i),ResourceSetting.Effect_Width,ResourceSetting.Effect_Height, ResourceSetting.EffectStrResource(i), ResourceSetting.Effect_iSprite, ResourceSetting.Effect_nDelay);
        }
    }
    
    @Override
    public VisibleGameObject CreateObject(int index)
    {
        if ((index < 0) || (index >= _nprototype))
        {
            return null;
        }
        return _prototype[index].Clone();
    }
}
